<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<!DOCTYPE html>
<html>
<head>
    <title>迅购网 - 订单信息</title>
    <%@ include file="../../common/taglib.jsp" %>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="${ctx}/home/assets/ystep/css/ystep.css">
    <style type="text/css">
        #list_hd_line {
            width: 100%;
            height: 1px;
            background-color: #e4e4e4;
            overflow: hidden;
            top: 35px;
            left: 0;
            position: absolute;
        }

        .orderMsgTitle {
            float: left;
            width: 78px;
            font-weight: 700;
            min-height: 30px;
            margin-bottom: 4px;
            line-height: 30px;
        }

        .orderMsgContent {
            min-height: 30px;
            margin-bottom: 4px;
            font-size: 15px;
            line-height: 30px;
        }

        .orderMsg {
            padding: 10px 20px;
            overflow: hidden;
        }
        .search-btn {
            width: 155px;
            height: 45px;
            line-height: 45px;
            background: #3B9BFF;
            border-radius: 2px;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            border:0;
        }
    </style>
</head>
<body>
    <%
        SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd   HH:mm:ss");
        request.setAttribute("fmt",fmt);
    %>
    <jsp:include page="../../global/head.jsp" flush="true">
        <jsp:param name="showkj" value="0"/>
    </jsp:include>
    <input type="hidden" name="orderId" value="${order.id}">
    <input type="hidden" name="status" value="${order.status}">
    <input type="hidden" name="cancelReason" value="${order.cancelReason}">

    <input type="hidden" id="placeOrderTime" value="${fmt.format(order.placeOrderTime)}">
    <c:if test="${order.deliverGoodsTime!=null}">
    <input type="hidden" id="deliverGoodsTime" value="${fmt.format(order.deliverGoodsTime)}">
    </c:if>
    <c:if test="${order.receiveGoodsTime!=null}">
    <input type="hidden" id="receiveGoodsTime" value="${fmt.format(order.receiveGoodsTime)}">
    </c:if>
    <input type="hidden" id="orderSum" value="${order.sum}">
    <input type="hidden" id="receiverLat" value="${receiver.latitude}">
    <input type="hidden" id="receiverLng" value="${receiver.longitude}">
    <input type="hidden" id="receiverProvince" value="${receiver.province}">
    <input type="hidden" id="receiverAddress"
           value="${receiver.province=="北京"||receiver.province=="上海"||receiver.province=="天津"||receiver.province=="重庆"?"":receiver.province} ${receiver.city} ${receiver.area} ${receiver.addressDetail}">

    <div class="payment-interface w1200" style="margin-bottom: 50px;">
        <c:if test="${param.deliver!=null}">
            <script type="text/javascript">
                $(function(){
                    alert("请选择送货人");
                });
            </script>
            <div class="pay-info">
                <div class="info-tit">
                    <h3>选择送货人</h3>
                </div>
                <ul class="pay-dz">
                    <c:if test="${senderList.size()==0}">
                        <span style="font-size:15px;color:#b83126;margin-left:15px;">暂无送货人</span>
                        <button class="btn" style="margin-left: 15px;">
                            <a href="${ctx}/user/shopManage.do?page=addSenderPageA">去添加</a>
                        </button>
                    </c:if>
                    <c:forEach items="${senderList}" var="sender" varStatus="status">
                        <li name="senderLi" onclick="selectSender(this)"
                            <c:if test="${status.index>3}">style="margin-top:30px;"</c:if>
                            <c:if test="${status.index==0}">class="current"</c:if>>
                            <input type="hidden" name="senderName" value="${sender.name}">
                            <input type="hidden" name="senderId" value="${sender.id}">
                            <h3>
                                <span class="sp3">${sender.name}</span> （负责寄送）</h3>
                            <p style="margin-top:5px;">
                                <span>TEL：${sender.phone}</span>
                            </p>
                        </li>
                    </c:forEach>
                    <div style="clear:both;"></div>
                </ul>
            </div>
        </c:if>
        <div class="pay-info" id="orderDetail">
            <div class="info-tit">
                <h3>订单信息</h3>
            </div>
            <dl class="orderMsg">
                <dt class="orderMsgTitle" <c:if test='${order.status=="3" ||order.status=="4"}'>style="height: 90px;"</c:if>
                    <c:if test='${order.status!="4" && order.status!="3"}'>style="height: 60px;line-height: 60px;" </c:if>>
                    订单状态：
                </dt>
                <dd class="orderMsgContent">
                    <c:if test='${order.status=="3"}'>
                        买家已取消订单<br>取消原因：${order.cancelReason}<br>取消时间：${fmt.format(order.cancelTime)}
                    </c:if>
                    <c:if test='${order.status=="4"}'>
                        卖家已取消订单<br>取消原因：${order.cancelReason}<br>取消时间：${fmt.format(order.cancelTime)}
                    </c:if>
                    <c:if test='${order.status!="4" && order.status!="3"}'>
                        <div id="orderStatus" style="padding-left: 100px;"></div>
                    </c:if>
                </dd>
                <dt class="orderMsgTitle">
                    收货人：
                </dt>
                <dd class="orderMsgContent">
                    ${receiver.name}，
                    ${receiver.phone}，
                    ${receiver.province=="北京"||receiver.province=="上海"||receiver.province=="天津"||receiver.province=="重庆"?"":receiver.province}
                    ${receiver.city}
                    ${receiver.area}
                    ${receiver.addressDetail}
                </dd>
                <dt class="orderMsgTitle">
                </dt>
                <dd>
                    <div id="map" style="width:60%;height:280px;border: 1px solid #d8d8db;"></div>
                </dd>
                <c:if test='${sender != null}'>
                    <dt class="orderMsgTitle" style="    margin-top: 20px;">
                        送货人：
                    </dt>
                    <dd class="orderMsgContent" style="    margin-top: 20px;">
                            ${sender.name}，${sender.phone}
                    </dd>
                </c:if>
            </dl>
        </div>
        <div class="pay-info" style="margin-bottom: 0px;">
            <div class="info-tit" style="border-bottom:0;">
                <h3>商品信息</h3>
            </div>
        </div>
        <div class="cart-con-info" style="position: relative;">
            <p id="list_hd_line" class="abs distribution">&nbsp;</p>
            <div class="cart-con-tit" style="margin-top: 15px;  ">
                <p class="p1">
                    <span>图片</span>
                </p>
                <p class="p2">商品名称</p>
                <p class="p4">数量</p>
                <p class="p5">单价（元）</p>
                <p class="p6">金额（元）</p>
                <c:if test="${order.status==2}">
                    <p class="p6">评论</p>
                </c:if>
            </div>
            <div class="info-tijiao">
                <p class="p1">实付款：<span id="total"></span></p>
            </div>
        </div>
        <c:if test="${param.deliver!=null}">
            <div class="cart-con-info" style="position: relative;text-align: center;">
                <input type="button" id="submitShopAuthentication" class="search-btn" onclick="confirmDeliver();" value="确认发货">
            </div>
        </c:if>
    </div>
    <script type="text/javascript" src="${ctx}/home/assets/ystep/js/ystep.js"></script>
    <script type="text/javascript" src="${ctx}/home/module/order/js/orderDetail.js"></script>
    <script type="text/javascript"
            src="http://api.map.baidu.com/api?v=2.0&ak=9AWkO508ejznfczgToGLxYqaN1Po4vYI&callback=mapCallback"></script>
</body>
</html>